CREATE TABLE [dbo].[TDAMAR_CPAG]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[CO_UNID_CONC] [dbo].[TD_VC_003] NOT NULL,
[FE_AMAR] [dbo].[TD_DT_001] NOT NULL,
[NU_AMAR] [dbo].[TD_VC_008] NOT NULL,
[NU_SECU] [dbo].[TD_IN_001] NOT NULL CONSTRAINT [DF__TDAMAR_CP__NU_SE__351DDF8C] DEFAULT ((0)),
[CO_TIDO_DEST] [dbo].[TD_VC_003] NULL,
[NU_DOCU_DEST] [dbo].[TD_VC_020] NULL,
[IM_PAGO_DEST] [dbo].[TD_NU_016_004] NULL CONSTRAINT [DF__TDAMAR_CP__IM_PA__361203C5] DEFAULT ((0)),
[IM_SALD_DEST] [dbo].[TD_NU_016_004] NULL CONSTRAINT [DF__TDAMAR_CP__IM_SA__370627FE] DEFAULT ((0)),
[IM_SALD_CDES] [dbo].[TD_NU_016_004] NULL CONSTRAINT [DF__TDAMAR_CP__IM_SA__37FA4C37] DEFAULT ((0)),
[NU_DOCU_ORIG] [dbo].[TD_VC_020] NULL,
[IM_PAGO_CDES] [dbo].[TD_NU_016_004] NULL CONSTRAINT [DF__TDAMAR_CP__IM_PA__38EE7070] DEFAULT ((0)),
[IM_PAGO_ORIG] [dbo].[TD_NU_016_004] NULL CONSTRAINT [DF__TDAMAR_CP__IM_PA__39E294A9] DEFAULT ((0)),
[CO_ENTI] [dbo].[TD_VC_020] NULL,
[TI_COMP_PAGO] [dbo].[TD_VC_003] NULL,
[IM_SALD_ORIG] [dbo].[TD_NU_016_004] NULL CONSTRAINT [DF__TDAMAR_CP__IM_SA__3AD6B8E2] DEFAULT ((0)),
[ST_CIER_DOCU] [dbo].[TD_VC_001_SINO] NULL CONSTRAINT [DF__TDAMAR_CP__ST_CI__3BCADD1B] DEFAULT ('N'),
[NU_CUOT] [dbo].[TD_IN_001] NULL CONSTRAINT [DF__TDAMAR_CP__NU_CU__3DB3258D] DEFAULT ((0)),
[IM_SALD_CORI] [dbo].[TD_NU_016_004] NULL CONSTRAINT [DF__TDAMAR_CP__IM_SA__3EA749C6] DEFAULT ((0)),
[IM_PAGO_CORI] [dbo].[TD_NU_016_004] NULL CONSTRAINT [DF__TDAMAR_CP__IM_PA__3F9B6DFF] DEFAULT ((0)),
[IM_MAPL_MORI] [dbo].[TD_NU_016_004] NULL CONSTRAINT [DF__TDAMAR_CP__IM_MA__408F9238] DEFAULT ((0)),
[IM_MAPL_MCON] [dbo].[TD_NU_016_004] NULL CONSTRAINT [DF__TDAMAR_CP__IM_MA__4183B671] DEFAULT ((0)),
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TDAMAR_CP__CO_US__4277DAAA] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TDAMAR_CP__FE_US__436BFEE3] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TDAMAR_CP__CO_US__4460231C] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TDAMAR_CP__FE_US__45544755] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TDAMAR_CPAG] WITH NOCHECK ADD CONSTRAINT [CK__TDAMAR_CP__ST_CI__3CBF0154] CHECK NOT FOR REPLICATION (([ST_CIER_DOCU]='N' OR [ST_CIER_DOCU]='S'))
GO
ALTER TABLE [dbo].[TDAMAR_CPAG] ADD CONSTRAINT [PK__TDAMAR_C__0DB6B7A9623B6A1D] PRIMARY KEY CLUSTERED  ([CO_EMPR], [CO_UNID_CONC], [FE_AMAR], [NU_AMAR], [NU_SECU]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TDAMAR_CPAG] ADD CONSTRAINT [FK__TDAMAR_CPAG__22FFFAA8] FOREIGN KEY ([CO_EMPR], [CO_UNID_CONC], [FE_AMAR], [NU_AMAR]) REFERENCES [dbo].[TCAMAR_CPAG] ([CO_EMPR], [CO_UNID_CONC], [FE_AMAR], [NU_AMAR])
GO
